function onLoad() {
	var lnk = document.getElementById("lnk");
	activateTab(lnk);
}
function showEditDetails() {
	var details = document.getElementById("trDetails");
	var editDetails = document.getElementById("trEditDetails");	
	details.style.display = "none";
	editDetails.style.display = "";
}
function closeEditDetails() {
	var details = document.getElementById("trDetails");
	var editDetails = document.getElementById("trEditDetails");	
	details.style.display = "";
	editDetails.style.display = "none";
}
function activateTab(current_tab) {	
	closeEditDetails();	
	var p_tbl = current_tab.parentNode.parentNode.parentNode.parentNode;	
	var tabs = p_tbl.getElementsByTagName("a");	
	var j = 0;	
	for (var i=0; i<tabs.length; i++) {
		var a = tabs[i];
		var div = a.getElementsByTagName("div")[0];
		var div1 = div.getElementsByTagName("div")[0];		
		var class1 = div.className;
		var class2 = div1.className;
		if (current_tab==a) {				
			if (class2.charAt(class2.length-1)=="_") {
				div1.className = class2.substring(0, class2.length-1);
				div.className = class1.substring(0, class1.length-1);
				j = i;
			}			
		}
		else {
			if (class1.charAt(class1.length-1)!="_") {
				div1.className = class2 + "_";
				div.className = class1 + "_";
			}
		}
	}
	
	var tbl_account = document.getElementById("account");
	
	for (var i=0; i<tbl_account.rows.length; i++) {
		var row = tbl_account.rows[i];
		row.style.display = "none";
		if (i==j) {
			row.style.display = "";
			if (i==0) {
				document.getElementById("trEditDetails").style.display = "none";
			}
		}
	}
}